r = 1 gotcellphone = 1 gotkey = 1 SCREEN 12 COLOR 7, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 10 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 10) AS STRING directions(1) = "SOUTH" directions(2) = "NORTH OR SOUTH" directions(3) = "NORTH OR EAST" directions(4) = "EAST OR WEST" directions(5) = "NORTH OR WEST" directions(6) = "EAST, WEST, OR SOUTH" directions(7) = "EAST" directions(8) = "EAST OR WEST" directions(9) = "WEST OR SOUTH" directions(10) = "NORTH" PRINT "" PRINT "" PRINT "A night like no other. You are walking home after a late shift. You are tired" PRINT "and the thought of going to bed, makes you pick up the pace. But as the street" PRINT "seems dead, more dead than usual...a night of horror is upon thee as the dead" PRINT "have taken to walken the Earth." PRINT "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT PRINT " " PRINT " " PRINT " " PRINT " Streets of the Dead " PRINT " " PRINT " Written by " PRINT " " PRINT " D.B. Taylor" PRINT "" PRINT " Copyright (c) 2015" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 IF r = 9 THEN: GOSUB r9 IF r = 10 THEN: GOSUB r10 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK BEER" PRINT "UNLOCK - UNLOCK DOOR" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gotkey = 1 THEN: PRINT "House Key" IF gotcellphone = 1 THEN: PRINT "Cell Phone" PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 3 THEN: r = 2: GOTO moved IF r = 2 THEN: r = 1: GOTO moved IF r = 5 THEN: r = 6: GOTO moved IF r = 10 THEN: r = 9: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 3 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 5: GOTO moved IF r = 7 THEN: r = 6: GOTO moved IF r = 6 THEN: r = 8: GOTO moved IF r = 8 THEN: r = 9: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 1 THEN: r = 2: GOTO moved IF r = 2 THEN: r = 3: GOTO moved IF r = 6 THEN: r = 5: GOTO moved IF r = 9 THEN: r = 10: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 5 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 3: GOTO moved IF r = 9 THEN: r = 8: GOTO moved IF r = 8 THEN: r = 6: GOTO moved IF r = 6 THEN: r = 7: GOTO moved END IF IF (cmd$ = "TALK TO THE DEAD") AND r = 7 THEN CLS PRINT "Hey...are you okay? -You get no response...until she slowly turns" PRINT "around reveals that her flesh as been rotting off for quite some" PRINT "time now. She slowly begin's to walk towards you." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE THE DEAD") AND r = 7 THEN CLS PRINT "A large group of about twenty or so in a group. They sway back and" PRINT "forth. As if they are waiting for someone to walk by them." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE CELL PHONE") AND gotcellphone = 1 THEN CLS PRINT "A sleek black phone that's fully charged." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE KEY") AND gotkey = 1 THEN CLS PRINT "The key to your front door." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "USE KEY") AND gotpen = 1 AND r = 10 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "USE CELL PHONE") AND gotcellphone = 1 THEN CLS GOTO lose: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "A long night at work and as the bar shuts down for the night." PRINT "You are only a few blocks away from the comfort of your bed." RETURN r2: PRINT "The cold night air embraces you as you are the only one still up" PRINT "at this hour." RETURN r3: PRINT "You feel as if you are walking through an abandoned city of sorts." PRINT "Not a soul in sight or a car driving around either...odd for a" PRINT "Saturday night." RETURN r4: PRINT "A strange sound, a cry almost, muffled by the pains of life. A shiver" PRINT "runs through your body. You wonder just what is lurking in the darkness?" RETURN r5: PRINT "Your are standing at the corner of the street and the groans of those" PRINT "who cannot be seen." RETURN r6: PRINT "Just a few blocks away from your home. The sound continues to grow" PRINT "louder. As if whoever is making it is just feet away." RETURN r7: PRINT "You are standing before a gorup of people...just standing around as" PRINT "if they are waiting for something. They clothes they are wearing a torn" PRINT "and a foul smell arises from them. Almost as if they are dead?" RETURN r8: PRINT "The muffled groans of the horde grow louder as if they are following" PRINT "you. A cold breeze embraces you to where you can see your breath." RETURN r9: PRINT "The lights from the other homes are off, which is odd for this to" PRINT "be. Most of the time someone's up watching tv...but not tonight." RETURN r10: PRINT "Standing at your front door. You feel your heart pounding a mile" PRINT "a minute. Time to unlock the door and hide from the darkness." RETURN win: COLOR 2, 0 CLS PRINT "You quickly fumble for your house key and as you unlock the" PRINT "door, you quickly run into the safety of your humble home." PRINT "But before you slam the door in utter fear, you turn to see" PRINT "that the horde of the undead are slowly approaching you." PRINT DO: LOOP UNTIL INKEY$ <> "" END lose: COLOR 2, 0 CLS PRINT "You take out the cell phone and just as you are about to dial" PRINT "the horde quickly swamrs you and before you know it. They are" PRINT "feasting upon your corpse. Maybe the other side isn't so bad" PRINT "after all." PRINT DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "You take to long getting home and before you know it. The horde of" PRINT "the dead overcome the population and soon the out number the living" PRINT "by five thousand to one. An air raid siren goes off as the military" PRINT "decides to open fire and turn the city in rubble." _DISPLAY END END SUB